package com.mikelouis.test.scala.proginscala.scalacheck

/**
 * Created by yuazhu on 4/18/2015.
 */
object QuickStart extends App {

  import org.scalacheck.Prop.forAll

  // 定义一个属性
  val propConcatLists = forAll { (l1: List[Int], l2: List[Int]) => l1.size + l2.size == (l1 ::: l2).size}

  // 检查属性
  propConcatLists.check

  // 这个声明的属性hold不住. 输入的参数-1会证伪这个属性声明
  val propSqrt = forAll { (n: Int) => math.sqrt(n * n) == n}
  propSqrt.check

}
